package com.github.shuaidd.service.mapper;

import com.github.shuaidd.model.entity.PersistentTokenEntity;
import com.github.shuaidd.model.repository.PersistentTokenEntityMapper;
import lombok.AllArgsConstructor;
import org.activiti.engine.ManagementService;
import org.activiti.engine.impl.cmd.AbstractCustomSqlExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 描述
 *
 * @author ddshuai
 * @date 2020-07-18 08:11
 **/
@AllArgsConstructor(onConstructor_ = {@Autowired})
@Service
public class PersistentTokenService extends BaseMapperService implements PersistentTokenEntityMapper {

    @Override
    public int deleteByPrimaryKey(String series) {
        return managementService.executeCustomSql(new AbstractCustomSqlExecution<PersistentTokenEntityMapper, Integer>(PersistentTokenEntityMapper.class) {
            @Override
            public Integer execute(PersistentTokenEntityMapper persistentTokenEntityMapper) {
                return persistentTokenEntityMapper.deleteByPrimaryKey(series);
            }
        });
    }

    @Override
    public int insert(PersistentTokenEntity record) {
        return 0;
    }

    @Override
    public int insertSelective(PersistentTokenEntity record) {
        return 0;
    }

    @Override
    public PersistentTokenEntity selectByPrimaryKey(String series) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(PersistentTokenEntity record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(PersistentTokenEntity record) {
        return 0;
    }
}
